package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;

import com.ricchieri.dao.interf.IRoleDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.Role;

public class RoleDao extends GenericDao implements IRoleDao {
	private static final long serialVersionUID = 2721837824010947343L;

	@Override
	@SuppressWarnings("unchecked")
	public List<Role> getAllRole(BasicFilter filter) {
		Criteria criteria = criteriaAllRole(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllRole(BasicFilter filter) {
		return super.criteriaAllBasic(filter, Role.class);
	}	
	
	@Override
	protected String getTableName() {
		return "role";
	}
}
